#include "length.h"

//length=sqrt(||v||^2)
double Length (std::valarray<double> v) {
    double length = 0;
    for (unsigned i=0; i<v.size(); i++) {
        length += v[i]*v[i];
    }
    return sqrt(length);
}
